<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>花礼网后台管理系统-分类管理</title>
    <base href="http://${pageContext.request.serverName }:${pageContext.request.serverPort }${pageContext.request.contextPath }/" />
    <link rel="stylesheet" href="css/bootstrap.css">
    <script src="js/jquery-3.6.0.js"></script>
    <script src="js/laydate/laydate.js"></script>
    <link rel="stylesheet" href="css/Top.css">
    <link rel="stylesheet" href="css/Left.css">
    <link rel="stylesheet" href="css/commodityList.css">
</head>
<body>
<div class="container-fluid">

    <div class="row">
        <div class="col-md-2 stick"><%@include file="Left.jsp"%></div>
        <div class="col-md-10 col-md-offset-2"><%@include file="Top.jsp"%></div>
        <div class="col-md-10 col-md-offset-2">

            <%--            模糊查询--%>
            <form class="form-inline" action="manager/orderListServlet.shtml" method="post">
                <div class="form-group">
                    <label>订单编号</label>
                    <input type="text" name="id" value="" class="form-control" placeholder="订单编号">
                </div>
                <div class="form-group">
                    <label>状态</label>
                    <select class="form-control" name="stateid">
                        <option value="">全部</option>
                        <c:forEach items="${requestScope.stateList}" var="st">
                            <option value="${st.id}">${st.statename}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group">
                    <label>下单日期</label>
                    <input type="text" width="100" name="orderdate" id="addDate" height="25" class="form-control"/>
                </div>
                <div class="form-group">
                    <label>收货人电话</label>
                    <input type="text" name="shouphone" value="" class="form-control">
                </div>
                <button type="submit" class="btn btn-primary">查询</button>
            </form>

            <%--查询的商品数据--%>
            <div class="box">
                <table class="table table-hover">
                    <th>订单编号</th>
                    <th>收货人</th>
                    <th>收货人手机</th>
                    <th>下单日期</th>
                    <th>配送日期</th>
                    <th>状态</th>
                    <th>查看</th>
                    <th>操作</th>
                    <c:forEach items="${requestScope.orderPageInfo.list}" var="o">
                        <tr class="datarow">
                            <td>${o.id}</td>
                            <td>${o.shouname}</td>
                            <td>${o.shouphone}</td>
                            <td>${o.orderdateStr}</td>
                            <td>${o.servicedateStr}</td>
                            <td>${o.orderstateStr}</td>
                            <td>
                                <a href="manager/orderDetailServlet.shtml?id=${o.id}">
                                    <button type="button" class="btn btn-info">详情</button>
                                </a>
                            </td>
                            <c:if test="${o.orderstate==2}" var="os">
                                <td>
                                    <a href="manager/faHuoServlet.shtml?orderid=${o.id}" onclick="return confirm('确认发货吗？')">
                                        <button type="button" class="btn btn-info">发货</button>
                                    </a>
                                </td>
                            </c:if>
                            <c:if test="${!os}">
                                <td> </td>
                            </c:if>
                        </tr>


                    </c:forEach>
                </table>
            </div>
            <%--分页数据--%>
            <div class="box">
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <c:set var="p" value="${requestScope.orderPageInfo}"></c:set>
                            <a href="manager/commodityClassServlet?pageNo=${p.prePage<1?1:p.prePage}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li><a href="manager/commodityClassServlet?pageNo=1">首页</a></li>
                        <c:forEach items="${requestScope.orderPageInfo.navigatepageNums}" var="i">
                            <c:if test="${i==requestScope.orderPageInfo.pageNum}" var="f">
                                <li class="active"><a href="manager/orderListServlet.shtml?pageNo=${i}">${i}</a></li>
                            </c:if>
                            <c:if test="${!f}">
                                <li><a href="manager/orderListServlet.shtml?pageNo=${i}">${i}</a></li>
                            </c:if>
                        </c:forEach>
                        <li><a href="manager/orderListServlet.shtml?pageNo=${requestScope.orderPageInfo.pages}">末页</a></li>
                        <li>
                            <a href="manager/orderListServlet.shtml?pageNo=${p.nextPage==0?p.pages:p.nextPage}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                        共${requestScope.orderPageInfo.total}条数据，共${requestScope.orderPageInfo.pages}页
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    $(function (){
        //左侧‘分类管理’变红
        $("#ul li:nth-child(4) a").css("color","red");
        $("#let").html("订单列表");

        //日期框子
        laydate.render({
            elem: '#addDate' ,//指定元素
        });




    })
</script>

</html>
